<template>
  <div>
    <table class="table">
      <thead>
      <tr>
        <th>ID</th>
        <th>商品名</th>
        <th>商品英文名</th>
      </tr>
      </thead>
      <tbody v-for="(item, index) in allredwine" :key="index">
      <tr>
        <td>{{ item.id }}</td>
        <router-link :to="{path: `/redwine/${item.id}`}">
          <td>{{ item.title }}</td>
        </router-link>
        <td>http://commodity.yyeport.com/redwine/{{ item.id }}</td>
      </tr>
      </tbody>
    </table>
    <!--<table id="ArbetTable"></table>-->
  </div>
</template>

<script>
import {getRedWine} from '../../api/api'

export default {
  name: 'redwine',
  data () {
    return {
      allredwine: null
    }
  },
  methods: {
    getAllRedWine () {
      getRedWine().then((response) => {
        console.log(response.data)
        this.allredwine = response.data
      })
    }
  },
  created () {
    this.getAllRedWine()
  }
}
</script>

<style scoped>

</style>
